#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <math.h>

#include "dominion.h"
#include "dominion_helpers.h"
#include "rngs.h"

void test_village()
{
	int currentPlayer;
	struct gameState state;
	int handPos;
	int old_handCount;

	currentPlayer = 0;
	handPos = 0;
	state.numActions = 1;

	state.handCount[currentPlayer] = 5;
	old_handCount = state.handCount[currentPlayer] - 1;

	cardEffect(village, 0, 0, 0, &state, handPos, 0);

	/* Test One: ensure player gets one more card */
	if (state.handCount[currentPlayer] == old_handCount + 1) {
		printf("Test One: PASS\n");
	}
	else {
		printf("Test One: Fail - did not draw new card\n");
	}

	/* Test Two: ensure two more actions are given */
	if (state.numActions == 3) {
		printf("Test Two: PASS\n");
	}
	else {
		printf("Test Two: FAIL - did not attain two more actions\n");
	}

	/* Test Three: ensure village card is discarded */
	if (state.handCount[currentPlayer] == 5) {
		printf("Test Three: PASS\n");
	}
	else {
		printf("Test Three: FAIL - did not discard village card\n");
	}
}

int main(void)
{
	test_village();
	return EXIT_SUCCESS;
}